Preparation


In [1]:
%matplotlib notebook

Imports


In [2]:
import multicell
import numpy as np

Problem definition

Simulation and tissue structure


In [3]:
sim = multicell.simulation_builder.generate_cell_grid_sim(20, 20, 1, 1e-3)

Tissue growth

We first enable growth and specify the number of growth steps to be applied over the duration of the simulation. Growth steps are spaced evenly.

Note: this should not be used in conjunction with set_time_steps, as the two settings would otherwise conflict.


In [4]:
sim.enable_growth(n_steps=11)

We then register the growth method we would like to apply. In this case, it is linear_growth, which requires a coefficient parameter specifying the scaling to be applied at each time step, along each axis.


In [5]:
sim.register_growth_method(multicell.growth.linear_growth, {"coefficient": [1.1, 1.05, 1.]})

Cell divisions

We first enable cell divisions and register the method we would like to use. In this case, we use a method called symmetrical_division, which divides a cell through its centroid, perpendicularly to its longest axis.


In [6]:
sim.enable_division()
sim.register_division_method(multicell.division.symmetrical_division)

We also register the division trigger, which is used to check if a cell needs to be divided. Here, it is a volume-related trigger, which requires a threshold.


In [7]:
sim.register_division_trigger(multicell.division.volume_trigger, {"volume_threshold": 2.})

Rendering


In [8]:
sim.register_renderer(multicell.rendering.MatplotlibRenderer, None, {"view_size": 60, "view": (90, -90), "axes": False})

Visualization of the initial state


In [9]:
sim.renderer.display()


Time point: 0.0

Simulation

As the tissue grows, it maintains its rectangular shape. Cells grow in a uniform manner (they all grow by the same amount) and all divide at the same time when they reach the volume threshold.


In [10]:
sim.simulate()


Growth step #0
Growth of the tissue: 0.689544916153 seconds
Cell divisions: 0.952747106552 seconds
Time point: 0.0909090909091
Growth step #1
Growth of the tissue: 0.55749297142 seconds
Cell divisions: 0.514989852905 seconds
Time point: 0.181818181818
Growth step #2
Growth of the tissue: 0.497236967087 seconds
Cell divisions: 0.546725988388 seconds
Time point: 0.272727272727
Growth step #3
Growth of the tissue: 0.517410039902 seconds
Cell divisions: 0.574597120285 seconds
Time point: 0.363636363636
Growth step #4
Growth of the tissue: 0.48425412178 seconds
Cell divisions: 1.86181807518 seconds
Time point: 0.454545454545
Growth step #5
Growth of the tissue: 1.23253798485 seconds
Cell divisions: 1.58813095093 seconds
Time point: 0.545454545455
Growth step #6
Growth of the tissue: 1.17254805565 seconds
Cell divisions: 1.68955206871 seconds
Time point: 0.636363636364
Growth step #7
Growth of the tissue: 1.29916810989 seconds
Cell divisions: 1.64202809334 seconds
Time point: 0.727272727273
Growth step #8
Growth of the tissue: 1.26322984695 seconds
Cell divisions: 1.6054008007 seconds
Time point: 0.818181818182
Growth step #9
Growth of the tissue: 1.23599100113 seconds
Cell divisions: 5.31329917908 seconds
Time point: 0.909090909091
Growth step #10
Growth of the tissue: 2.88810992241 seconds
Cell divisions: 4.3902258873 seconds
Time point: 1.0